package com.ruoyi.exam.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.BkppingAccountMapper;
import com.ruoyi.exam.domain.BkppingAccount;
import com.ruoyi.exam.service.IBkppingAccountService;

/**
 * 账户Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-04
 */
@Service
@DataSource(value = DataSourceType.BOOKKEEPING)
public class BkppingAccountServiceImpl implements IBkppingAccountService 
{
    @Autowired
    private BkppingAccountMapper bkppingAccountMapper;

    /**
     * 查询账户
     * 
     * @param id 账户主键
     * @return 账户
     */
    @Override
    public BkppingAccount selectBkppingAccountById(Long id)
    {
        return bkppingAccountMapper.selectBkppingAccountById(id);
    }

    /**
     * 查询账户列表
     * 
     * @param bkppingAccount 账户
     * @return 账户
     */
    @Override
    public List<BkppingAccount> selectBkppingAccountList(BkppingAccount bkppingAccount)
    {
        return bkppingAccountMapper.selectBkppingAccountList(bkppingAccount);
    }

    /**
     * 新增账户
     * 
     * @param bkppingAccount 账户
     * @return 结果
     */
    @Override
    public int insertBkppingAccount(BkppingAccount bkppingAccount)
    {
        bkppingAccount.setCreateTime(DateUtils.getNowDate());
        return bkppingAccountMapper.insertBkppingAccount(bkppingAccount);
    }

    /**
     * 修改账户
     * 
     * @param bkppingAccount 账户
     * @return 结果
     */
    @Override
    public int updateBkppingAccount(BkppingAccount bkppingAccount)
    {
        return bkppingAccountMapper.updateBkppingAccount(bkppingAccount);
    }

    /**
     * 批量删除账户
     * 
     * @param ids 需要删除的账户主键
     * @return 结果
     */
    @Override
    public int deleteBkppingAccountByIds(Long[] ids)
    {
        return bkppingAccountMapper.deleteBkppingAccountByIds(ids);
    }

    /**
     * 删除账户信息
     * 
     * @param id 账户主键
     * @return 结果
     */
    @Override
    public int deleteBkppingAccountById(Long id)
    {
        return bkppingAccountMapper.deleteBkppingAccountById(id);
    }
}